package com.fwj.authorization.staff.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fwj.authorization.staff.entity.SysButton;
import com.fwj.authorization.staff.mapper.SysButtonMapper;
import com.fwj.authorization.staff.service.SysButtonService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * SysButtonServiceImpl
 *
 * @author 樊温军
 * @date 2025/3/22 下午4:42
 */
@Slf4j
@Service
@RequiredArgsConstructor
public class SysButtonServiceImpl extends ServiceImpl<SysButtonMapper, SysButton> implements SysButtonService {
    @Override
    public IPage<SysButton> getPage(Page<SysButton> page, SysButton sysButton) {
        return baseMapper.getPage(page, sysButton);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public Boolean saveButton(List<SysButton> sysButtons) {
        return this.saveOrUpdateBatch(sysButtons);
    }
}
